<?php /* 
<div class="content_filtro">
    <div class="filtro">
        <form id="form_filtro" method="post" action="">
            <i>Pesquisar</i>
            <label><?php echo elemform::radio('itfiltro','itfiltro','1',$this->filtro); ?> Ativo</label>
            <label><?php echo elemform::radio('itfiltro','itfiltro','0',$this->filtro); ?> Inativo</label>
        </form>
    </div>
    
</div>
*/ ?>

<div class="content-list">
    
    <h2><a href="<?php echo $this->voltar; ?>">Matrícula</a> &RightArrow; <?php echo $this->titulo;?></h2>
    
    <table id="tlist">
        <thead>
            <tr>
                <th width="60px">Parcela</th>
                <th width="60px">Data</th>
                <th width="60px">Matrícula</th>
                <th width="100px">Aluno</th>
                <th width="80px">Forma Pgt</th>
                <th width="80px">Valor</th> 
                <th width="100px">Pagamento</th>
                <th class="bc"></th>
            </tr>
        </thead>
        <tbody>
            <?php 
            $total = 0;
            $count_bol = 0; 
            foreach($this->result as $key => $row) { 
                if($row['PAR_STAPGO'] != 2) $total += $row['PAR_VLR'];
                
                if($row['FOR_ID'] == 1) $count_bol++;
            ?>
                <tr>  
                    <td><?php echo $row['PAR_NUM']; ?></td>
                    <td style="text-align: center"><?php echo Datetools::amd_dma($row['PAR_DAT']); ?></td>
                    <td><?php echo $row['MAT_ID'] ?></td>
                    <td><?php echo $row['ALU_NOM'] ?></td>
                    <td><?php echo $row['FOR_NOM'] ?></td>
                    <td style="text-align: right"><?php echo tools::float_to_money($row['PAR_VLR']); ?></td>
                    <td><?php echo tools::returnStatusPag($row['PAR_STAPGO']); ?></td>
                    <td class="bc">
                        <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row['PAR_NUM'])); ?>">Editar</a><?php }?>
                        <?php /* if($this->per_edt && $mat[0]['FOR_ID'] == 1 && $row['PAR_STAPGO == 0){?><a class="btn-pdr" href="javascript:callPrint('<?php echo $this->url(array('controller' => $this->controller, 'action' => 'boleto', 'mat_id' => $row['MAT_ID, 'id' => $row['PAR_NUM'])); ?>')">Imprimir</a><?php } */ ?>
                        <?php if($this->per_edt && $row['FOR_ID'] == 1 && $row['PAR_STAPGO'] == 0){?><a class="btn-pdr" target="_blank" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'boleto', 'mat_id' => $row['MAT_ID'], 'id' => $row['PAR_NUM'])); ?>">Imprimir</a><?php } ?>
                        <?php /* if($this->per_del && $row['PAR_STA'] == 1 && $row['PAR_STAPGO'] == 0){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'delete', 'id' => $row['PAR_NUM'], 'mat_id' => $row['MAT_ID'])); ?>">Deletar</a><?php } */ ?>
                    </td>
                </tr>
            <?php } ?>
            <?php if($total > 0) { ?>
                <tr class="totais">
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td style="text-align: right"><?php echo tools::float_to_money($total); ?></td>
                    <td class="bc">
                        <?php if($count_bol > 1) { ?>
                            <a class="btn-pdr" target="_blank" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'boleto', 'mat_id' => $this->MAT_ID )); ?>">Imprimir Todos</a>
                        <?php } ?>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>